<?php

declare (strict_types=1);
namespace App\Model;

use App\Traits\ModelLabelTrait;
use Hyperf\Database\Model\SoftDeletes;
use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id 
 * @property string $name 
 * @property string $label 
 * @property int $pid 
 * @property string $guard_name 
 * @property string $type 
 * @property string $method 
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 * @property string $deleted_at 
 */
class RbacRoute extends Model
{
    use SoftDeletes,ModelLabelTrait;
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'rbac_route';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name',
        'label',
        'url',
        'pid',
        'type',
        'method'
    ];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'int', 'pid' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    const TYPE_ADMINFRONT ='adminfront';
    const TYPE_ADMINAPI = 'adminapi';

    const TYPE_LABELS = [
        self::TYPE_ADMINAPI => '后台api',
        self::TYPE_ADMINFRONT => '后台前端'
    ];

}